
import React, { Component } from 'react'
import { Content, Text, List, ListItem, Thumbnail, Icon, View } from 'native-base'

import theme from '../../themes/base-theme'
import styles from './style'

const thumbnail = require('../../../img/thumbnail.png')

const SideBar = (props) => {
  const { navigation, onPersonPress, onAccountPress } = props
  return (
    <Content theme={theme} style={styles.sidebar} >
      <List>
        <ListItem>
          <Thumbnail source={thumbnail} />
          <Text>用户名</Text>
          <Text note>签名...</Text>
        </ListItem>
        <ListItem button onPress={ () => onPersonPress(navigation) }>
          <View style={styles.iconContainer}>
            <Icon name="ios-person" />
          </View>
          <Text style={styles.btnText}>个人信息</Text>
        </ListItem>

        <ListItem button onPress={ () => onAccountPress(navigation) }>
          <View style={styles.iconContainer}>
            <Icon name="ios-settings" />
          </View>
          <Text style={styles.btnText}>账户设置</Text>
        </ListItem>
      </List>
    </Content>
  )
}

SideBar.propTypes = {
  navigation: React.PropTypes.shape({}),
}

export default SideBar
